<!--
 * @Descripttion: 啦啦啦哈哈哈
 * @version: 
 * @Author: lsy
 * @Date: 2021-09-26 16:24:00
 * @LastEditors: liushengyan
 * @LastEditTime: 2022-06-09 17:45:41
-->
<template>
  <!-- vue3弃用v-on="$listeners" -->
  <el-table v-bind="$attrs">
    <template v-for="item in columns" :key="item.id">
      <el-table-column v-if="!item.slot" v-bind="item.attrs" />
      <el-table-column v-if="item.slot" v-bind="item.attrs">
        <!-- vue3弃用slot-scope -->
        <template v-slot="scope">
          <slot :scope="scope" :name="item.slot"></slot>
        </template>
      </el-table-column>
    </template>
  </el-table>
</template>
<script setup>
const props = defineProps({
  columns: {
    type: Array,
    /**
     * @description:
     * @param {}
     * @return {[{attrs: { label: "序号",type: "index",width: "50",align: "center" },id: 1 }]}
     */
    default: () => [],
  },
});
</script>
<style lang="scss" scoped></style>
